﻿<!--
 Peter
 Created by: Peter Development Team
    http://peter.codeplex.com/
 
 GNU General Public License version 2 (GPLv2)
    http://peter.codeplex.com/license
-->
<UserControl x:Class="Peter.Ftp.View.ViewFtp"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:logic="clr-namespace:Peter.Ftp.Logic"
             xmlns:icons="clr-namespace:Peter.Common.Icons;assembly=Peter.Common"
             xmlns:mainmenu="clr-namespace:Peter.Common.MainMenu;assembly=Peter.Common"
             xmlns:controls="clr-namespace:Peter.Common.Controls;assembly=Peter.Common"
             mc:Ignorable="d"
             d:DataContext="{d:DesignInstance logic:ModelFtp}"
             d:DesignHeight="300"
             d:DesignWidth="300">
   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
      </Grid.RowDefinitions>

      <mainmenu:MainMenu Grid.Row="0"
                         IconSize="Small"
                         ItemsSource="{Binding Path=MenuItems}" />

      <controls:TreeViewEx Grid.Row="1"
                           x:Name="_TreeFtp"
                           ExecuteCommand="{Binding Path=ExecuteCommand}"
                           SelectedTreeItem="{Binding Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                           ItemsSource="{Binding Path=FtpItems}">

         <controls:TreeViewEx.ItemTemplate>
            <HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
               <Grid>
                  <Grid.Resources>

                  </Grid.Resources>
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="Auto" />
                     <ColumnDefinition Width="*" />
                  </Grid.ColumnDefinitions>
                  <icons:IconDisplay Icon="{Binding Path=Icon}"
                                     IconSize="Medium"
                                     Margin="3,2" />
                  <TextBlock Text="{Binding Path=Text}"
                             VerticalAlignment="Center"
                             Grid.Column="1" />
               </Grid>
            </HierarchicalDataTemplate>
         </controls:TreeViewEx.ItemTemplate>
      </controls:TreeViewEx>
   </Grid>
</UserControl>
